package com.cg.controller;

import com.cg.client.MeetingClient;
import com.cg.dto.Result;
import com.cg.entity.Meetingroom;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName MeetingController
 * @Description TODO
 * @Author CG
 * @Date 2023/12/18 9:15
 **/
@RestController
@RequestMapping("/meeting")
public class MeetingController {

    @Resource
    private MeetingClient meetingClient;

    /**
     * 查询全部会议室预定情况
     */
    @GetMapping("/queryMeetingRoomAll")
    public Result<List<Meetingroom>> queryMeetingRoomAll(){
        return meetingClient.queryMeetingRoomAll();
    }


    /**
     * 查询所有的会议室名字
     */
    @GetMapping("/queryMeetingRoomName")
    public Result<List<Meetingroom>> queryMeetingRoomName(){
        return meetingClient.queryMeetingRoomName();
    }


    /**
     * 会议室预定
     */
    @PostMapping("/insertMeeting")
    public Result insertMeeting(Meetingroom meetingroom){
        return meetingClient.insertMeeting(meetingroom);
    }
}
